| Conditions | 5 |
| Total Lines | 23 |
| Code Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import Xdebug from '../extensions/php/xdebug' |
||
| 10 | execute = async (status: string): Promise<boolean> => { |
||
| 11 | if (status !== 'on' && status !== 'off') { |
||
| 12 | error('Invalid status. Please provide status \'on\' or \'off\'.') |
||
| 13 | return false |
||
| 14 | } |
||
| 15 | |||
| 16 | const xdebug = new Xdebug() |
||
| 17 | let restart = false |
||
| 18 | |||
| 19 | if (status === 'on') { |
||
| 20 | restart = await this.enable(xdebug) |
||
| 21 | } |
||
| 22 | |||
| 23 | if (status === 'off') { |
||
| 24 | restart = await this.disable(xdebug) |
||
| 25 | } |
||
| 26 | |||
| 27 | if (restart) { |
||
| 28 | const php = await getLinkedPhpVersion() |
||
| 29 | await php.restart() |
||
| 30 | } |
||
| 31 | |||
| 32 | return true |
||
| 33 | } |
||
| 67 | export default XdebugController |